import java.util.Random;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: jingziyou
 * Date: 2023-03-20
 * Time: 16:26
 */
class Student {
    int number;
    int state;
    float score;
}

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random rand = new Random();
        Student[] stu = new Student[20];
        for (int i = 0; i < stu.length; i++) {
            stu[i] =new Student();
            stu[i].number = sc.nextInt();
            stu[i].state = rand.nextInt(4) + 1;
            stu[i].score = (float)Math.random()*101;
        }
        for (Student student : stu) {
            if (student.state == 4)
                System.out.println(student.number + " " + student.state + " " + student.score);
        }
        System.out.println();
        bubbleSort(stu);
        for (Student student : stu) {
            System.out.println(student.number + " " + student.state + " " + student.score);
        }
    }
    public static void bubbleSort(Student[] stu) {
        for (int i = 0; i < stu.length - 1; i++) {
            for (int j = 1; j < stu.length - i; j++) {
                if (stu[j - 1].score < stu[j].score) {
                    Student tmp = stu[j - 1];
                    stu[j - 1] = stu[j];
                    stu[j] = tmp;
                }
            }
        }
    }
}
